import request from '@/router/axios';
import param from '@/views/system/param';

export const getList = (current, size, params) => {
  return request({
    url: '/api/blade-report/report/rest/list',
    method: 'get',
    params: {
      ...params,
      current,
      size
    }
  });
};
export const remove = (ids) => {
  return request({
    url: '/api/blade-report/report/rest/remove',
    method: 'post',
    params: {
      ids
    }
  });
};
// 获取产品直通率
export const getPassthroughRate = (params) => {
  return request({
    url: '/api/mes-abacus/statProductionDay/query-page-product-yield-first-pass-yield',
    method: 'GET',
    params: {
      ...params
    }
  });
};

// 获取产品直通率图表
export const getPassthroughRateChart = (params) => {
  return request({
    url: '/api/mes-abacus/statProductionDay/calculate-product-yield-first-pass-yield',
    method: 'GET',
    params: {
      ...params
    }
  });
};
// 获取产品直通率表头
export const getColum = () => {
  return request({
    url: '/api/mes-abacus/statProductionDay/get-line-production-value-columns',
    method: 'GET'
  });
};
// 获取产值数据
export const getDataList = (params) => {
  return request({
    url: '/api/mes-abacus/statProductionDay/queryPage/production-line/production-value',
    method: 'GET',
    params: {
      ...params
    }
  });
};

export const getMaintenanceList = (params) => {
  return request({
    url: '/api/mes-abacus/statMroCenterProduct/top',
    method: 'GET',
    params: {
      ...params
    }
  });
};

export const getDetailList = (params) => {
  return request({
    url: '/api/mes-abacus/statMroCenterProduct/list-detail',
    method: 'GET',
    params: {
      ...params
    }
  });
};
export const getProductivityReportList = (params) => {
  return request({
    url: '/api/mes-product/workorder/production-efficiency',
    method: 'GET',
    params: {
      ...params
    }
  });
};
// 产值换线报表
export const getChangeLineReportData = (params) => {
  return request({
    url: '/api/mes-abacus/statLineChange/page-query',
    method: 'GET',
    params: {
      ...params
    }
  });
};

//产值换线报表导出
export const exportChangeLineReportData = (params) => {
  return request({
    url: `/api/mes-abacus/statLineChange/export`,
    method: 'get',
    params: {
      ...params
    },
    responseType: 'blob'
  });
};

//产值换线报表图表数据
export const getChangeLineReportChartData = (params) => {
  return request({
    url: '/api/mes-abacus/statLineChange/get-list-by-query-wrapper',
    method: 'GET',
    params: {
      ...params
    }
  });
};

//产品平衡率报表
export const getBalanceReportData = (params) => {
  return request({
    url: '/api/mes-abacus/statroutebalancing/page-query',
    method: 'GET',
    params: {
      ...params
    }
  });
};

//产品平衡率报表图表数据
export const getBalanceReportChartData = (params) => {
  return request({
    url: '/api/mes-abacus/statroutebalancing/list',
    method: 'GET',
    params: {
      ...params
    }
  });
};

//产品平衡率报表导出
export const exportBalanceReportChartData = (params) => {
  return request({
    url: '/api/mes-abacus/statroutebalancing/export',
    method: 'GET',
    params: {
      ...params
    },
    responseType: 'blob'
  });
};

//产品平衡率报表
export const getWorkorderEfficiencyData = (current, size, params) => {
  return request({
    url: '/api/mes-abacus/statProductionDay/page-query-work-order-efficiency',
    method: 'GET',
    params: {
      ...params,
      current,
      size
    }
  });
};

//产品平衡率报表导出
export const exportWorkorderEfficiencyData = (params) => {
  return request({
    url: '/api/mes-abacus/statProductionDay/export-work-order-efficiency',
    method: 'POST',
    params: { ...params },
    responseType: 'blob'
  });
};

// 分页查询车间PPM趋势分析
export const getWorkshopppmPage = (current, size, statisticsTimeDimension, params) => {
  return request({
    url: '/api/mes-abacus/statProductionDay/page-workshop-ppm',
    method: 'GET',
    params: {
      ...params,
      current,
      size,
      statisticsTimeDimension
    }
  });
};

//  查询车间PPM趋势分析列表
export const getWorkshopppmList = (params) => {
  return request({
    url: '/api/mes-abacus/statProductionDay/list-workshop-ppm',
    method: 'GET',
    params
  });
};

//  查询品质报表列表
export const getQualityList = (params) => {
  return request({
    url: '/api/mes-product/qms-inspection-document-report/pass-rate/page',
    method: 'GET',
    params
  });
};

// 获取产品直通率表头
export const getWorkSectionColum = () => {
  return request({
    url: '/api/mes-abacus/statProductionDay/get-work-section-production-value-columns',
    method: 'GET'
  });
};
// 获取产值数据
export const getWorkSectionDataList = (params) => {
  return request({
    url: '/api/mes-abacus/statProductionDay/query-page/work-section-production-value',
    method: 'GET',
    params: {
      ...params
    }
  });
};
